﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 实验报告3._2
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, string> dic1 = new Dictionary<string, string>();
            dic1.Add("雪", "snow");
            dic1.Add("风", "wind");
            dic1.Add("雨", "rain");
            Console.WriteLine("输入中文意思：");
            string word = Console.ReadLine();
            if(dic1.ContainsKey(word))
                Console.WriteLine("中文：{0}的英文为{1}",word,dic1[word]);
            else
                Console.WriteLine("字典中未有此单词");
           
            Dictionary<int,Tuple <string, string>> dic2 = new Dictionary<int,Tuple <string, string>>();
            dic2.Add(1, new Tuple<string, string>("九江", "上海"));
            dic2.Add(2, new Tuple<string, string>("南昌", "广东"));
            dic2.Add(3, new Tuple<string, string>("北京", "苏州"));
            Console.WriteLine("输入车次：");
            int number = Convert.ToInt32(Console.ReadLine());
            if (dic2.ContainsKey(number))
            {
                Console.WriteLine(dic2[number]);
            }
            else
                Console.WriteLine("无此辆车次 ");
            foreach (KeyValuePair<string, string> kvp in dic1)
            {
                Console.WriteLine("中文：{0}  英文：{1}", kvp.Key, kvp.Value);
            }

            foreach (KeyValuePair<int, Tuple<string, string>> kvp in dic2 )
            {
                Console.WriteLine("车次：{0}  始发站-终到站：{1}", kvp.Key, kvp.Value);
            }
            Console.ReadKey();
        }
    }
}
